$width: 700px;

html, body {
  width: 100%;
  line-height: 1.6;
  margin: 0;
}

* {
  box-sizing: border-box;
  //margin: 0;
  //padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
  //background-color: #a9e7da;
}

header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;

  h1 {
    margin: 20px 0 5px 10px;
    line-height: 1;

    a {
      color: #000;
    }
  }

  p {
    margin: 0 0 0 10px;
    color: #666;
  }

  a {
    text-decoration: none;
  }

  & > div {
    display: flex;
    margin-top: 5px;
  }
}

nav {
  position: sticky;
  z-index: 1000000;
  top: 0;
  width: 100%;
  //max-width: $width;
  //background-color: rgba(255, 255, 255, 1);
  //background-color: #dff8ff;
  background-color: #f1f7ff;
  display: flex;
  align-items: center;
  flex-direction: column;
  //background-color: rgba(255, 255, 255, 0.9);
  //backdrop-filter: blur(10px);

  ul {
    list-style: none;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;

    a {
      display: block;
      text-decoration: none;
      padding: 5px 10px;
      border-radius: 15px;
      color: #468ed8;
      margin-right: 5px;

      span {
        padding-bottom: 1px;
        border-bottom: #468ed8 solid 1px;
      }

      &:hover, &.active {
        text-decoration: none;
        background-color: #d5e6ff;
        //color: #222;
        //box-shadow: #222 0px 1px;

        span {
          border-bottom: none;
        }
      }
    }

    a.support {
      color: #c10029;

      span {
        border-bottom: #c10029 solid 1px;
      }

      &:hover, &.active {
        background: #ffd5ce;
        color: #c10029;

        span {
          border-bottom: none;
        }
      }
    }

    a.rainbow {
      background: linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8, #1098ad, #07b39b, #6fba82);
      animation: animatedgradient 5s linear alternate infinite;
      background-size: 300% 300%;
      text-decoration: none;
      color: #fff;
      //box-shadow: #222 0px 1px;

      &:hover {
        //color: #000;
        animation-play-state: paused;
      }
    }
  }

  @keyframes animatedgradient {
    0% {
      background-position: 0% 0%;
    }
    25% {
      background-position: 50% 50%;
    }
    50% {
      background-position: 100% 10%;
    }
    75% {
      background-position: 50% 50%;
    }
    100% {
      background-position: 0% 0%;
    }
  }
}

.page {
  width: 100%;
  max-width: $width;
  padding-left: 10px;
  padding-right: 10px;
  word-break: break-word;

  img {
    width: 100%;
    height: auto;
  }

  code, pre, tt {
    padding: .2em .4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, .05);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    white-space: normal;
  }

  h2 {
    font-size: 1.3em;
  }

  h3 {
    font-size: 1.1em;
    font-weight: 500;
  }

  table {
    border-collapse: collapse;

    thead {
      text-align: left;
      background-color: #eee;
    }

    thead {
      border-bottom: 7px solid #fff;
    }

    tr {
      border-bottom: 7px solid #fff;
      border-top: 7px solid #fff;
      vertical-align: baseline;
    }

    tr:first-child {
      border-bottom: none;
    }

    tr:last-child {
      border-top: none;
    }

    td {
      padding: 0;
    }

    td, th {
      border-left: 5px solid #fff;
      border-right: 5px solid #fff;
    }

    td:first-child, th:first-child {
      border-left: none;
    }

    td:last-child, th:last-child {
      border-right: none;
    }
  }

  li + li {
    margin-top: .25em;
  }

  a {
    color: #0366d6;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  /* Button row */
  .support-buttons {
    display: flex;
    justify-content: center;
    column-gap: 40px;
    row-gap: 55px;
    flex-wrap: wrap;
    margin-bottom: 70px;

    /* Wrapper: each button keeps its mascot */
    .support-button-wrapper {
      position: relative;
      display: inline-block;
      height: 120px; /* ensures space for mascot below */
    }

    /* Button shape + style */
    .support-button {
      width: 130px;
      height: 50px;
      border-radius: 22px;
      padding: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;

      background: linear-gradient(145deg, #ffffff, #dce8ff);
      box-shadow:
              4px 4px 10px rgba(0,0,0,0.15),
              -4px -4px 10px rgba(255,255,255,0.7);
      transition: transform 0.2s ease, box-shadow 0.2s ease;

      position: relative;
      overflow: hidden;
    }

    /* Shine streak */
    .support-button::before {
      content: "";
      position: absolute;
      top: 0;
      left: -150%;
      width: 50%;
      height: 100%;
      background: linear-gradient(
                      120deg,
                      rgba(255,255,255,0) 0%,
                      rgba(255,255,255,0.55) 50%,
                      rgba(255,255,255,0) 100%
      );
      transform: skewX(-20deg);
      opacity: 0;
    }

    .support-button:hover::before {
      animation: shine-sweep 0.8s forwards;
      opacity: 1;
    }

    @keyframes shine-sweep {
      0% { left: -150%; }
      100% { left: 200%; }
    }

    /* Button image */
    .support-button img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center;
    }

    /* Hover lift */
    .support-button:hover {
      transform: scale(1.08);
      box-shadow:
              6px 6px 15px rgba(0,0,0,0.18),
              -6px -6px 15px rgba(255,255,255,0.8);
    }

    /* Mascots */
    .mascot {
      position: absolute;
      width: 60px;
      bottom: -20px;
      left: 50%;
      transform: translateX(-50%) translateY(0);
      transition: transform 0.3s;
      pointer-events: none;
    }

    .rabbit { width: 50px } /* long ears '^^ /*

        /* Hover reactions */
    .support-button-wrapper:hover .cat { transform: translateX(-50%) translateY(-20px) rotate(-15deg); }
    .support-button-wrapper:hover .dog { transform: translateX(-50%) translateY(-20px) scaleX(-1); }
    .support-button-wrapper:hover .squirrel { transform: translateX(-50%) translateY(-20px) rotate(15deg); }
    .support-button-wrapper:hover .rabbit { transform: translateX(-50%) translateY(-20px) rotate(-10deg); }

    .support-button img.paypal { width: 60%; margin-top: 6px; }
    .support-button img.github-sponsors { width: 110%; margin-top: 6px; }
    .support-button img.stripe { width: 51%; margin-top: 4px; }
  }
}
